/*
2.36
/home/tool/mongodb-linux-x86_64-rhel70-3.6.9/bin/
[root@YH-ceshi-docker-5 bin]# ./mongo -host 10.100.2.12 -p 27017
MongoDB shell version v3.6.9
connecting to: mongodb://10.100.2.12:27017/
    Implicit session: session { "id" : UUID("965744f8-a4a6-40c3-9f0c-f16887ac4e2c") }
MongoDB server version: 3.6.3
> use analytics-dev
switched to db analytics-dev
> db.auth('analytics-dev','Wo4heike')
1
> show tables
user_event_data
>db.user_event_data.find()

*/



var mongodbClient = require('mongodb').MongoClient
var url = 'mongodb://analytics-dev:Wo4heike@10.100.2.12:27017/analytics-dev'

mongodbClient.connect(url,{ useNewUrlParser: true },function (err,db) {
    if (err)throw err;
    var collection = db.db('analytics-dev')
    console.log(collection)

   collection.collection('user_event_data').find().toArray(function (err,result) {
        if (err){
            console.log(`error:${err}`);
        }
        else {
            console.log(result)
        }
        db.close()
    })

})
